package com.android.delivery.util;

import android.widget.ImageView;

import com.android.delivery.R;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;

/**
 * @author: mqwang
 * @create: 2/19/21 5:55 PM
 * @Description:
 */
public class GlideUtil {

    public static void loadImg(ImageView iv, String url){
        Glide.with(iv.getContext()).load(url).apply(new RequestOptions().error(R.mipmap.ic_logo).placeholder(R.mipmap.ic_logo)).into(iv);

    }

    public static void loadCircleImg(ImageView iv, String url){
        Glide.with(iv.getContext()).asBitmap().load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_logo).transform(new CircleCrop())).into(iv);

    }

}
